/*
 * Copyright 2010-2011 Sanjay Dwivedi.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.isdinvestments.cam.domain.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the POSITION_SNAPSHOT database table.
 * 
 */
@Embeddable
public class PositionSnapshotPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private long id;

	@Column(name="POSITION_ID")
	private long positionId;

	@Column(name="EVENT_ID")
	private long eventId;

    public PositionSnapshotPK() {
    }
	public long getId() {
		return this.id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public long getPositionId() {
		return this.positionId;
	}
	public void setPositionId(long positionId) {
		this.positionId = positionId;
	}
	public long getEventId() {
		return this.eventId;
	}
	public void setEventId(long eventId) {
		this.eventId = eventId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PositionSnapshotPK)) {
			return false;
		}
		PositionSnapshotPK castOther = (PositionSnapshotPK)other;
		return 
			(this.id == castOther.id)
			&& (this.positionId == castOther.positionId)
			&& (this.eventId == castOther.eventId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.id ^ (this.id >>> 32)));
		hash = hash * prime + ((int) (this.positionId ^ (this.positionId >>> 32)));
		hash = hash * prime + ((int) (this.eventId ^ (this.eventId >>> 32)));
		
		return hash;
    }
}